if (!_gtk_widget_get_visible (child->widget))
continue;
- if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_width_for_height (child->widget,
- allocation->height,
- &sizes[i].minimum_size,
- &sizes[i].natural_size);
- else
- gtk_widget_get_preferred_height_and_baseline_for_width (child->widget,
- allocation->width,
- &sizes[i].minimum_size,
- &sizes[i].natural_size,
- NULL, NULL);
+ gtk_widget_measure (child->widget,
+ private->orientation,
+ private->orientation == GTK_ORIENTATION_HORIZONTAL ?
+ allocation->height : allocation->width,
+ &sizes[i].minimum_size, &sizes[i].natural_size,
+ NULL, NULL);
/* Assert the api is working properly */
if (sizes[i].minimum_size < 0)
child_minimum_baseline = -1;
child_natural_baseline = -1;
- gtk_widget_get_preferred_height_and_baseline_for_width (child->widget,
- child_allocation_width,
- &child_minimum_height, &child_natural_height,
- &child_minimum_baseline, &child_natural_baseline);
+ gtk_widget_measure (child->widget, GTK_ORIENTATION_VERTICAL,
+ child_allocation_width,
+ &child_minimum_height, &child_natural_height,
+ &child_minimum_baseline, &child_natural_baseline);
if (child_minimum_baseline >= 0)
{
else
req = &(sizes[child->pack][idx[child->pack]]);
- if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_width_for_height (child->widget,
- allocation->height,
- &req->minimum_size,
- &req->natural_size);
- else
- gtk_widget_get_preferred_height_and_baseline_for_width (child->widget,
- allocation->width,
- &req->minimum_size,
- &req->natural_size,
- NULL, NULL);
+ gtk_widget_measure (child->widget,
+ priv->orientation,
+ priv->orientation == GTK_ORIENTATION_HORIZONTAL ?
+ allocation->height : allocation->width,
+ &req->minimum_size, &req->natural_size,
+ NULL, NULL);
if (child != priv->center)
{
child_minimum_baseline = -1;
child_natural_baseline = -1;
- gtk_widget_get_preferred_height_and_baseline_for_width (child->widget,
- child_allocation_width,
- &child_minimum_height, &child_natural_height,
- &child_minimum_baseline, &child_natural_baseline);
+ gtk_widget_measure (child->widget,
+ GTK_ORIENTATION_VERTICAL,
+ child_allocation_width,
+ &child_minimum_height, &child_natural_height,
+ &child_minimum_baseline, &child_natural_baseline);
if (child_minimum_baseline >= 0)
{
gint child_minimum, child_natural;
gint child_minimum_baseline = -1, child_natural_baseline = -1;
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_width (child->widget,
- &child_minimum, &child_natural);
- else
- gtk_widget_get_preferred_height_and_baseline_for_width (child->widget, -1,
- &child_minimum, &child_natural,
- &child_minimum_baseline, &child_natural_baseline);
+ gtk_widget_measure (child->widget,
+ orientation,
+ -1,
+ &child_minimum, &child_natural,
+ &child_minimum_baseline, &child_natural_baseline);
if (private->orientation == orientation)
{
if (_gtk_widget_get_visible (child->widget))
{
- if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_width (child->widget,
- &sizes[i].minimum_size,
- &sizes[i].natural_size);
- else
- gtk_widget_get_preferred_height (child->widget,
- &sizes[i].minimum_size,
- &sizes[i].natural_size);
+ gtk_widget_measure (child->widget,
+ private->orientation,
+ -1,
+ &sizes[i].minimum_size, &sizes[i].natural_size,
+ NULL, NULL);
/* Assert the api is working properly */
if (sizes[i].minimum_size < 0)
child_minimum_baseline = child_natural_baseline = -1;
/* Assign the child's position. */
- if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_height_and_baseline_for_width (child->widget, child_size,
- &child_minimum, &child_natural,
- &child_minimum_baseline, &child_natural_baseline);
- else /* (private->orientation == GTK_ORIENTATION_VERTICAL) */
- gtk_widget_get_preferred_width_for_height (child->widget,
- child_size, &child_minimum, &child_natural);
+ gtk_widget_measure (child->widget,
+ OPPOSITE_ORIENTATION (private->orientation),
+ child_size,
+ &child_minimum, &child_natural,
+ &child_minimum_baseline, &child_natural_baseline);
if (child_minimum_baseline >= 0)
{
if (_gtk_widget_get_visible (child->widget))
{
- if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_width_for_height (child->widget,
- avail_size, &child_size, &child_natural);
- else
- gtk_widget_get_preferred_height_for_width (child->widget,
- avail_size, &child_size, &child_natural);
-
+ gtk_widget_measure (child->widget,
+ private->orientation,
+ avail_size,
+ &child_size, &child_natural,
+ NULL, NULL);
if (child_size > largest_child)
largest_child = child_size;